<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>新订单管理</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
		$(document).ready(function() {
			//$("#name").focus();
			$("#inputForm").validate({
				submitHandler: function(form){
					loading('正在提交，请稍等...');
					form.submit();
				},
				errorContainer: "#messageBox",
				errorPlacement: function(error, element) {
					$("#messageBox").text("输入有误，请先更正。");
					if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
						error.appendTo(element.parent().parent());
					} else {
						error.insertAfter(element);
					}
				}
			});
		});
	</script>
</head>
<body>
	<ul class="nav nav-tabs">
		<li class="active"><a href="${ctx}/mer/merOrder/form?id=${merOrder.id}">订单<shiro:hasPermission name="mer:merOrder:edit">${not empty merOrder.id?'修改':'添加'}</shiro:hasPermission><shiro:lacksPermission name="mer:merOrder:edit">查看</shiro:lacksPermission></a></li>
	</ul><br/>
	<form:form id="inputForm" modelAttribute="merOrder" action="${ctx}/mer/merOrder/save" method="post" class="form-horizontal">
		<form:hidden path="id"/>
		<sys:message content="${message}"/>		
		<div class="control-group">
			<label class="control-label">用户：</label>
			<div class="controls">
				<form:input path="customer.nickname" htmlEscape="false" maxlength="64" class="input-xlarge required" disabled="true"/>
				<span class="help-inline"><font color="red">*</font> </span>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">刚下单时的价格：</label>
			<div class="controls">
				<form:input path="rawPrice" htmlEscape="false" class="input-xlarge  number" disabled="true"/>
			</div>
		</div>
<%-- 		<div class="control-group">
			<label class="control-label">价格调整次数，为砍价等保留：</label>
			<div class="controls">
				<form:input path="adjustNum" htmlEscape="false" maxlength="11" class="input-xlarge  digits"/>
			</div>
		</div> --%>
		<div class="control-group">
			<label class="control-label">真正支付的价格：</label>
			<div class="controls">
				<form:input path="currentPrice" htmlEscape="false" class="input-xlarge  number" disabled="true"/>
			</div>
		</div>
		
		<div class="control-group">
			<label class="control-label">收件人姓名：</label>
			<div class="controls">
				<form:input path="recipientName" htmlEscape="false" maxlength="255" class="input-xlarge " disabled="true"/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">收件人地址：</label>
			<div class="controls">
				<form:input path="recipientProvince" htmlEscape="false" maxlength="20" class="input-xlarge " disabled="true"/>
				<form:input path="recipientCity" htmlEscape="false" maxlength="20" class="input-xlarge " disabled="true"/>
				<form:input path="recipientCounty" htmlEscape="false" maxlength="20" class="input-xlarge " disabled="true"/>
				<form:input path="recipientAddress" htmlEscape="false" maxlength="100" class="input-xlarge " disabled="true"/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">收件人手机号码：</label>
			<div class="controls">
				<form:input path="recipientMobile" htmlEscape="false" maxlength="255" class="input-xlarge " disabled="true"/>
			</div>
		</div>
				<div class="control-group">
			<label class="control-label">买家留言：</label>
			<div class="controls">
				<form:textarea path="note" htmlEscape="false" rows="4" maxlength="255" class="input-xlarge " disabled="true"/>
			</div>
		</div>
<%-- 		<div class="control-group">
			<label class="control-label">transport_fee：</label>
			<div class="controls">
				<form:input path="transportFee" htmlEscape="false" class="input-xlarge  number"/>
			</div>
		</div> --%>
		<div class="control-group">
			<label class="control-label">订单状态:</label>
			<div class="controls">
				<form:select path="status" class="input-xlarge">
					<form:option value="" label="请选择"/>
					<form:options items="${fns:getDictList('order_status')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
				</form:select>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">快递类型：</label>
			<div class="controls">
				<form:select path="transportType" class="input-xlarge">
					<form:option value="" label="请选择"/>
					<form:options items="${fns:getDictList('express')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
				</form:select>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">快递单号：</label>
			<div class="controls">
				<form:input path="transportId" htmlEscape="false" maxlength="64" class="input-xlarge "/>
			</div>
		</div>

		<div class="control-group">
			<label class="control-label">卖家备注：</label>
			<div class="controls">
				<form:textarea path="remarks" htmlEscape="false" rows="4" maxlength="255" class="input-xxlarge "/>
			</div>
		</div>
		
		<table id="contentTable" class="table table-striped table-bordered table-condensed">
		<thead>
			<tr>
				<th>商品名称</th>
				<th>商品编码</th>
				<th>商品图片</th>
				<th>规格</th>
				<th>件数</th>
				<th>价格</th>
				<th>更新日期</th>
			</tr>
		</thead>
		<tbody>
		<c:forEach items="${orderSkuList}" var="orderSku">
			<tr>
				<td>
					${orderSku.sku.spu.name}
				</td>
				<td>
					${orderSku.sku.spu.code}
				</td>
				<td style="width:40px;height:40px">
					<img alt="" src="${orderSku.sku.spu.photoThumb}">
				</td>
				<td>
					${orderSku.sku.color.name},${orderSku.sku.size.name}
				</td>
				<td>
					${orderSku.skuNum}
				</td>
				<td>
					${orderSku.sku.price}
				</td>
				<td>
					<fmt:formatDate value="${orderSku.updateDate}" pattern="yyyy-MM-dd HH:mm:ss"/>
				</td>
			</tr>
		</c:forEach>
		</tbody>
		</table>
		<div class="form-actions">
			 <shiro:hasPermission name="mer:merOrder:edit"><input id="btnSubmit" class="btn btn-primary" type="submit" value="保 存"/>&nbsp;</shiro:hasPermission>
			<input id="btnCancel" class="btn" type="button" value="返 回" onclick="history.go(-1)"/> 
		</div>
	</form:form>
</body>
</html>